<script setup lang="ts">

import { useCounterStore } from './stores/useCounterStore'
import { storeToRefs } from 'pinia'

const counterStore = useCounterStore()
const { count, doubleCount } = storeToRefs(counterStore)
// action 可以直接解构, 没有问题
const { increment } = counterStore
</script>

<template>
  <div>hello world</div>
  <div>{{ count }}</div>
  <div>{{ doubleCount }}</div>
  <input v-model="count" />
  <button @click="increment">无明增长</button>
</template>

<style scoped></style>
